import json
from common.baseApi import BaseAPI


class Admin_Goods(BaseAPI):

    # 设置（代卖）
    def update_price(self, goods_id, headers, in_data):
        resp_data = self.requests_send(
            path_params={'goods_id': goods_id},
            headers=headers,
            json=in_data
        )
        return resp_data


if __name__ == '__main__':
    payload = {
        "goods_name": "REGSERAPH瑞格奢妃 酵母蛋白果蔬酵素益生菌复合压片糖果30片 肠道调理",
        "seller_id": "1861312381154615298",
        "seller_name": "品牌折扣",
        "shop_cat_id": "0",
        "brand_id": "1953658126917820418",
        "category_id": "163",
        "goods_type": "NORMAL",
        "market_enable": 1,
        "point_disable": 0,
        "exchange_point": 0,
        "disabled": 1,
        "is_auth": 1,
        "source_type": "SELF",
        "shop_type": "SUPPLIER",
        "goods_id": "1953662441296314369",
        "sn": "1209381902381",
        "intro": "",
        "weight": 100,
        "price": "400",
        "shop_price": None,
        "cost": 300,
        "shop_cost": 300,
        "mktprice": None,
        "supplier_price": 100,
        "have_spec": 0,
        "create_time": "1754624397",
        "last_modify": "1755483364",
        "view_count": 0,
        "buy_count": 44,
        "quantity": 0,
        "enable_quantity": 0,
        "page_title": "test",
        "meta_keywords": "test",
        "meta_description": "test",
        "grade": 100,
        "thumbnail": "https://shuogeshi-1255375710.cos.ap-beijing.myqcloud.com/javashop6173c31a-e4a9-41d6-a286-9c21ec8360d6.jpg",
        "big": "https://shuogeshi-1255375710.cos.ap-beijing.myqcloud.com/javashop6173c31a-e4a9-41d6-a286-9c21ec8360d6.jpg",
        "small": "https://shuogeshi-1255375710.cos.ap-beijing.myqcloud.com/javashop6173c31a-e4a9-41d6-a286-9c21ec8360d6.jpg",
        "original": "https://shuogeshi-1255375710.cos.ap-beijing.myqcloud.com/javashop6173c31a-e4a9-41d6-a286-9c21ec8360d6.jpg",
        "comment_num": 0,
        "template_id": "0",
        "free_freight": 1,
        "auth_message": None,
        "under_message": "店员[gys1]操作下架，原因为：测试品",
        "self_operated": 1,
        "mobile_intro": "",
        "goods_video": "",
        "priority": 1,
        "expired_date": 0,
        "recommend": 0,
        "source_id": "0",
        "management_category": "35",
        "supplier_name": None,
        "sales_model": None,
        "member_shop": 1,
        "sales_model_detail": "",
        "sku_vo": None,
        "shop_commission": 50,
        "goods_store": "test",
        "lock_version": 6,
        "profit": "0%"
    }
    headers = {
        'Content-Type': 'application/json'
    }

    res = Admin_Goods(env='test', host_type='sgs_url').update_price("1953662441296314369", headers, payload)
    print(res)
